This repository was archived by the owner on Jan 19, 2019. It is now read-only.
Fix: Add parameter type annotations to the AST (refs #105) #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turns out we were never actually adding the type annotations of function parameters to the final AST. The tokens were tracked, and so this was not having any adverse effects, but it means we were lacking some information that would be needed for future rules and assertions for the TS 2.x special "typed-this" parameter.
Once this PR goes in the final TS 2.x PR (relating to that typed-this assertion) is ready to go and we can ship our first TS 2 release
I am sorry about the large diff, given that this is a change which affects any typed function parameters it affects 11-12 different test cases.
I have traditionally reconciled things like this by hand to minimise the noise, but I did actually run your
node tools/update-typescript-tests.js
helper this time and it seems to have switched around the order of some things in the resulting AST.